package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.domain.model.LoginUser;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.framework.web.service.SysLoginService;
import com.ruoyi.framework.web.service.TokenService;
import com.ruoyi.system.domain.vo.huimin.FilmlVo;
import com.ruoyi.system.service.IHuiminScreeningService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @ClassName HuiminScreeningController
 * @Author YangFu
 * @Date 2024/3/17 18:00
 * @Version 1.0
 */
@RestController
@RequestMapping("/system/hs/huimin")
@RequiredArgsConstructor
@Api(tags = {"(app)惠民放映API"})
public class HuiminScreeningController {


    private final IHuiminScreeningService huiminScreeningService;

    private final TokenService tokenService;

    @GetMapping("/getHuimin")
    @ApiOperation("惠民放映-获取华数电影-外部推荐")
    public AjaxResult<List<FilmlVo>> getHuimin(){
        LoginUser loginUser = SecurityUtils.getLoginUser();
        String token = tokenService.createToken(loginUser);
        List<FilmlVo> vos= huiminScreeningService.getHuimin(token);
        return AjaxResult.success(vos);
    }

}
